import request from '@/utils/request'
import { HTTP_METHOD } from '@/utils/http'

const BASE_URL = '/admin'

/**
 * @export 获取产品配置
 * @return {*}
 */
export function getProduct () {
  return request({
    url: `${BASE_URL}/product`,
    method: HTTP_METHOD.GET,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API,
  })
}

/**
 * @export 配置产品配置
 * @return {*}
 */
 export function modifyProduct (data) {
  return request({
    url: `${BASE_URL}/product`,
    method: HTTP_METHOD.POST,
    data,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API,
  })
}

/**
 * @export 获取还款设置
 * @return {*}
 */
 export function getDeduction () {
  return request({
    url: `${BASE_URL}/deduction`,
    method: HTTP_METHOD.GET,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API,
  })
}

/**
 * @export 配置还款配置
 * @return {*}
 */
 export function modifyDeduction (data) {
  return request({
    url: `${BASE_URL}/deduction`,
    method: HTTP_METHOD.POST,
    data,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API,
  })
}

/**
 * @export 改变预审状态
 */
export function changePreExamineStatus () {
  return request({
    url: `${BASE_URL}/Switch`,
    method: HTTP_METHOD.POST,
    baseURL: process.env.VUE_APP_RISK_ENGINE_BASE_API,
  })
}
